<#assign itemList=[
{"title":"","name":"id","value":"${model!''}","elements":"input","type":"hidden","eleList":[],"verify":"required"},
{"title":"输入框","name":"title","value":"","elements":"input","type":"text","eleList":[],"verify":"required"},
{"title":"输入框","name":"teacher","value":"","elements":"input","type":"text","eleList":[],"verify":""},
{"title":"当选按钮","name":"ccFlag","value":"0","elements":"input","type":"radio","eleList":[{"code":"0","value":"否"},{"code":"1001","value":"是"}],"verify":""},
{"title":"单选按钮2","name":"roomTypeCd","value":"2","elements":"input","type":"radio","eleList":[{"code":"2","value":"视频模式"},{"code":"5","value":"文档模式"}],"verify":""},
{"title":"复选框","name":"checkTypeCd","value":"2","elements":"input","type":"checkbox","eleList":[{"code":"2","value":"视频模式"},{"code":"5","value":"文档模式"}],"verify":""},
{"title":"输入框","name":"roomId","value":"","elements":"input","type":"text","eleList":[],"verify":""},
{"title":"价格","name":"price","value":"0","elements":"input","type":"text","eleList":[],"verify":"integer"}
]/>
<#import "parentedit.ftl" as edit>
<@edit.edit url="" itemList=itemList>

<script>
layui.use(['form', 'layer'], function () {
	var form = layui.form,
        layer = layui.layer;
    $("input[name='roomTypeCd']").parent().parent().hide();		    
	form.on('radio(ccFlag)', function(data){
		changeType(data.value);
	});
});
function changeType(type) {
	if(type == "1001") {
		$("input[name='roomId']").parent().parent().hide();	
		$("input[name='roomTypeCd']").parent().parent().show();		
	} else{		
		$("input[name='roomId']").parent().parent().show();
		$("input[name='roomTypeCd']").parent().parent().hide();		
	} 
}
</script>
</@edit.edit>